import request from '@/utils/request'

// get 获得打折活动列表数据
export function getDiscountList(params) {
  return request({
    url: '/ops/discount/list',
    method: 'get',
    params
  })
}

// get 获得打折活动关联的课程列表数据
export function getCourseList(params) {
  return request({
    url: '/ops/course/discountList',
    method: 'get',
    params: { ids: params }
  })
}

// get 获得课程列表数据
export function getAllCourseList(params) {
  return request({
    url: '/ops/course/allList',
    method: 'get',
    params: { tenantId: params }
  })
}

// get 获得课程数据
export function getCourseById(params) {
  return request({
    url: '/ops/course/getById',
    method: 'get',
    params: { id: params }
  })
}

// get 删除打折活动数据
export function deleteDiscount(params) {
  return request({
    url: '/ops/discount/delete',
    method: 'get',
    params: { id: params }
  })
}

// post 修改打折活动数据
export function updateDiscount(data) {
  return request({
    url: '/ops/discount/update',
    method: 'post',
    data
  })
}

// post 修改打折活动数据
export function addDiscount(data) {
  return request({
    url: '/ops/discount/add',
    method: 'post',
    data
  })
}
